//
//  HomePageTableViewCell.m
//  CivilianTravel
//
//  Created by 许仕杰 on 16/7/22.
//  Copyright © 2016年 许仕杰. All rights reserved.
//

#import "HomePageTableViewCell.h"
#import "SpotModel.h"
@interface HomePageTableViewCell ()
@property (weak, nonatomic) IBOutlet UIImageView *avatar;
@property (weak, nonatomic) IBOutlet UILabel *name;
@property (weak, nonatomic) IBOutlet UILabel *typeName;
@property (weak, nonatomic) IBOutlet UILabel *address;

@end

@implementation HomePageTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

}

- (void)setCellWithModel:(SpotModel *)model{
    [self.avatar sd_setImageWithURL:[NSURL URLWithString:model.avatar]];
    self.name.text = model.name;
    NSArray *array = model.ptags;
    NSString *name = [NSString string];
    for (NSDictionary *dic in array) {
        name = [name stringByAppendingFormat:@"%@%@",dic[@"name"] ,@" "];
    }
    self.typeName.text= name;
    self.address.text = model.address;
}






@end
